package com.gitee.dgwcode.action;

import com.gitee.dgwcode.domain.Product;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.ValueStack;

public class ProductAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Product product;

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Override
	public String execute() throws Exception {
		
		//这里修改栈顶的值
		ValueStack stack = ActionContext.getContext().getValueStack();
		
		Product obj = new Product();
		obj.setProductname("amd");
		
		int x=1/0;
		//更新栈顶的值
		//stack.setValue("product", obj);
		
		return ActionSupport.SUCCESS;
	}

}
